package bio.file.printStream;

import org.junit.Test;

import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.charset.Charset;

/**
 * Instruction：
 * Author：@author MaLi
 */
public class PrintStream {
    @Test
    public void print(){
        try(PrintWriter writer = new PrintWriter(new FileWriter("printchar.txt", Charset.defaultCharset(),true),true);) {
            writer.println("hello printWriter");
            writer.println("hello FileWriter");
            writer.println("hello FileWriter中文");
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
